<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			div{
				margin: 40px;
			}
			#msg{
				color: red;
			}
			label{
				
			}
		</style>
		<script>
			function doLogin(){
				var msg=document.getElementById("msg");
				var username=document.getElementById("username").innerText;
				msg.innerText="欢迎"+username+"登录";
			}
			function doClear(){
				document.getElementById("username").value="";
				document.getElementById("password").value="";
			}
		</script>
	</head>
	<body>
		<div id="container">
			<div id="msg"></div>
			<section>
				<fieldset>
					<legend>登录</legend>
					<div>
						<label>用户名:</label>
						<input type="text" name="username" id="username" />
					</div>
					<div>
						<label>密码:</label>
						<input type="password" name="password" id="password" />
					</div>
					<div>
						<button onclick="doLogin();">登录</button>
						<button onclick="doClear();">清楚</button>
					</div>
				</fieldset>
			</section>
		</div>
	</body>
</html>
